//
//  BK_Confirm_Order_PriceList_Cell.m
//  bestkeep
//
//  Created by TOPTEAM on 2017/2/21.
//  Copyright © 2017年 utouu. All rights reserved.
//

#import "BK_Confirm_Order_PriceList_Cell.h"
#import "BK_OD_Color.h"
#import "BK_OD_Tool.h"
@implementation BK_Confirm_Order_PriceList_Cell
{
    UILabel *_detailType;
    UILabel *_detailMoneyAmount;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        [self initialize];
    }
    return self;
}

- (void)initialize
{
    self.separatorInset = UIEdgeInsetsMake(0, [UIScreen mainScreen].bounds.size.width, 0, 0);
    
    _detailType = [[UILabel alloc] init];
    _detailType.backgroundColor = [UIColor clearColor];
    _detailType.textColor = kOrderBlack1;
    [self.contentView addSubview:_detailType];
    
    _detailMoneyAmount = [[UILabel alloc] init];
    _detailMoneyAmount.backgroundColor = [UIColor clearColor];
    _detailMoneyAmount.textColor = kOrderBlack1;
    [self.contentView addSubview:_detailMoneyAmount];
    
    [self makeConstraints];
}

- (void)makeConstraints
{
    [_detailType mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(ApplicationBackGauge);
        make.top.mas_equalTo(self).offset(10);
    }];
    
    [_detailMoneyAmount mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-ApplicationBackGauge);
        make.centerY.mas_equalTo(_detailType);
    }];
}

- (void)fillData:(id)data
{
    if (!data) {
        return;
    }
    BK_orders_dic_order_amount_lable_list_Model *price = data[@"price"];
    NSString *integralGoodsId = data[@"integralGoodsId"];
    
    _detailType.text = price.lableName;
    _detailMoneyAmount.text = price.lableVaule;
    
    if (![integralGoodsId isEqualToString:@""] && [_detailType.text isEqualToString:@"积分兑换"])
    {
        _detailType.font = UIFontBoldCustom(14);
        _detailMoneyAmount.font = UIFontBoldCustom(14);
    }
    else{
        _detailType.font = UIFontNormal;
        _detailMoneyAmount.font = UIFontNormal;
    }
}

+ (CGFloat)computeHeight:(id)data
{
    CGSize textSize = [@"只为计算label高度" sizeWithAttributes:@{NSFontAttributeName : UIFontCustom(13)}];
    return 10 + textSize.height;
}
@end




